package com.fanxuankai.boot.confluent.web;

import com.fanxuankai.boot.confluent.dto.KsqldbObjectDTO;
import com.fanxuankai.boot.confluent.dto.KsqldbObjectDropDTO;
import com.fanxuankai.boot.confluent.service.KsqldbObjectService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author fanxuankai
 */
@RestController
@RequestMapping("ksqldb_object")
public class KsqldbObjectController {
    @Resource
    private KsqldbObjectService service;

    @PostMapping("create")
    public void create(@RequestBody KsqldbObjectDTO dto) throws Exception {
        service.create(dto);
    }

    @DeleteMapping("drop")
    public void drop(KsqldbObjectDropDTO dto) throws Exception {
        service.drop(dto);
    }
}
